package ru.beta2.testyard;

/**
 * Extension of script point abstraction for expect message script points.
 * <br/>
 * User: Inc
 * Date: 07.07.2008
 * Time: 6:10:50
 */
public interface ExpectMessageScript<T> extends Script
{

    /**
     * Indication about message receiving 
     * @return true if expected message was received
     */
    boolean isAcquired();

    /**
     * Retrieve actual received message
     * @return actual message
     */
    T getActualMessage();

    // todo tests
    /**
     * Allow register message listener to be notified when expected message is received.
     * Only one MessageListener is supported currently.
     * @param listener message listener
     */
    void registerMessageListener(MessageListener<T> listener);

}
